package com.chalmers.irc2you;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
/**
 * 
 * @author Scott
 *
 */
public class MessageView extends LinearLayout {
	private String msg;
	private String name;
	private String ts;
	private TextView msgView;
	private TextView timeView;
	private TextView nameView;



/**
 * 
 * @param context Application context
 * @param timeStamp A string containing a timestamp
 * @param name A string containing the senders name
 * @param message A string containing the message
 */
	public MessageView(Context context, String timeStamp, String name, String message) {
		super(context);
		this.name = name + ": ";
		this.msg = message;
		this.ts = "<"+timeStamp + "> ";
		
		//l�gg in xml filen messageview i objektet
		LayoutInflater inflater = (LayoutInflater) 
		context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		inflater.inflate(R.layout.messageview, this);
		//h�mta views, l�gg till text mm
		msgView = (TextView) findViewById(R.id.contentView);
		timeView =(TextView) findViewById(R.id.timeView);
		nameView =	(TextView) findViewById(R.id.nameView);
		msgView.setText(message);
		timeView.setText(timeStamp);
		nameView.setText(name);
		
		
	}
	
}
